package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
//        FileOutputStream(String name , boolean append) 当append为true，则给文件名后写内容，否则覆盖重写
        FileOutputStream fos = new FileOutputStream("fos.txt",true);

        /*String line = "帕瓦：本大爷是power。";

        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        System.out.println("写出完毕");*/

        fos.write("我最爱帕瓦".getBytes(StandardCharsets.UTF_8));
        System.out.println("success");

        fos.close();
    }
}
